<div class="content general-content" id="page-body">
    <div class="page offices">
        <h1>Find an Office</h1>
        <hr/>
        <table class="support-office">
            <tr>
                <td>
                    <h3 style="margin-top:0;padding-top:0">National Support Office</h3>
                </td>
                <td>
                    <p style="padding-top:8px;">
                        2/34 Navigator Place
                        <br/>Hendra Queensland 4011
                    </p>
                </td>
                <td>
                    <p style="padding-top:8px;">
                        (07) 3633 6900
                    </p>
                </td>
            </tr>
        </table>
        <hr/>
        <?php if (empty($office)) { ?>
            <h2>Go Gecko in QLD</h2>
            <hr/>
            <?php if (!empty($franchiseQLD)) { ?>
                <?php $totalQld = count($franchiseQLD); ?>
                <?php foreach ($franchiseQLD as $key => $franchise) { ?>
                    <?php if ($key % 3 == 0) { ?>
                        <table>
                            <tr>
                            <?php } ?>
                            <td>
                                <?php echo anchor('offices/office/' . $franchise->id, $franchise->name); ?>
                                <br/><?php echo $franchise->location_addr_street1 ?>
                                <br/><?php echo $franchise->location_addr_suburb . ' ' . $franchise->location_addr_state . ' ' . $franchise->location_addr_pcode ?>
                                <br/><strong>Phone: </strong><?php echo $franchise->phone ?>
                            </td>
                            <?php if (($key % 3 == 2) || ($key == $totalQld - 1)) { ?>
                            </tr>
                        </table>
                        <hr/>
                    <?php } ?>
                <?php } ?>
            <?php } ?>


            <h2>Go Gecko in NSW</h2>
            <hr/>
            <?php if (!empty($franchiseNSW)) { ?>
                <?php $totalQld = count($franchiseNSW); ?>
                <?php foreach ($franchiseNSW as $key => $franchise) { ?>
                    <?php if ($key % 3 == 0) { ?>
                        <table>
                            <tr>
                            <?php } ?>
                            <td>
                                <?php echo anchor('offices/office/' . $franchise->id, $franchise->name); ?>
                                <br/><?php echo $franchise->location_addr_street1 ?>
                                <br/><?php echo $franchise->location_addr_suburb . ' ' . $franchise->location_addr_state . ' ' . $franchise->location_addr_pcode ?>
                                <br/><strong>Phone: </strong><?php echo $franchise->phone ?>
                            </td>
                            <?php if (($key % 3 == 2) || ($key == $totalQld - 1)) { ?>
                            </tr>
                        </table>
                        <hr/>
                    <?php } ?>
                <?php } ?>
            <?php } ?>
            <h2>Go Gecko in SA</h2>
            <hr/>
            <?php if (!empty($franchiseSA)) { ?>
                <?php $totalQld = count($franchiseSA); ?>
                <?php foreach ($franchiseSA as $key => $franchise) { ?>
                    <?php if ($key % 3 == 0) { ?>
                        <table>
                            <tr>
                            <?php } ?>
                            <td>
                                <?php echo anchor('offices/office/' . $franchise->id, $franchise->name); ?>
                                <br/><?php echo $franchise->location_addr_street1 ?>
                                <br/><?php echo $franchise->location_addr_suburb . ' ' . $franchise->location_addr_state . ' ' . $franchise->location_addr_pcode ?>
                                <br/><strong>Phone: </strong><?php echo $franchise->phone ?>
                            </td>
                            <?php if (($key % 3 == 2) || ($key == $totalQld - 1)) { ?>
                            </tr>
                        </table>
                        <?php if ($key != $totalQld - 1) { ?>
                            <hr/>
                        <?php } ?>
                    <?php } ?>
                <?php } ?>
            <?php } ?>
        <?php } else { ?>
            <table>
                <tr>
                    <td>
                        <?php echo anchor('offices/office/' . $office->id, $office->name); ?>
                        <br/><?php echo $office->location_addr_street1 ?>
                        <br/><?php echo $office->location_addr_suburb . ' ' . $office->location_addr_state . ' ' . $office->location_addr_pcode ?>
                        <br/><strong>Phone: </strong><?php echo $office->phone ?>
                    </td>
                </tr>
            </table>     
        <?php } ?>
    </div>
    <div class="clearer"></div>
</div>
